package com.zheng.api.common.constant;

import com.zheng.common.base.BaseResult;

import java.util.Date;

/**
 * api系统常量枚举类
 * Created by shuzheng on 2017/2/19.
 */
public class ApiResult {

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    /**
     * 返回时间，获取当前服务器时间
     */
    private Date time = new Date();
    /**
     * 状态码：1成功，其他为失败
     */
    public int code;

    /**
     * 成功为success，其他为失败原因
     */
    public String message;

    /**
     * command，指令
     */
    public String command;
    /**
     * command，指令
     */
    public String machineCode;

    /**
     * 数据结果集
     */
    public Object data;

    public ApiResult(ApiResultConstant apiResultConstant, Object data) {
        this(apiResultConstant.getCode(), apiResultConstant.getMessage(),null,null, data);
    }

    public ApiResult(int code, String message,String command,String machineCode, Object data) {
        this.code = code;
        this.message = message;
        this.command = command;
        this.machineCode=machineCode;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getCommand() {
        return command;
    }

    public void setCommand(String command) {
        this.command = command;
    }

    public String getMachineCode() {
        return machineCode;
    }

    public void setMachineCode(String machineCode) {
        this.machineCode = machineCode;
    }



}
